from page.app_page_search import PageSearch
from page.app_page_shopping_cart import PageSpCart
from script import log


class TestAppCard:

    def test01_cart_success(self, driver, login):
        sea = PageSearch(driver)
        sea.page_search("华为耳机")
        cart = PageSpCart(driver)
        cart.page_sp_cart()
        result = cart.get_add_cart_success()
        print(f"添加结果为：{result}")
        log.info(f"添加结果为：{result}")
        assert "华为耳机" in result
        cart.app_shot("add_cart_success")
